package com.xgp.microChat.tool;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.util.List;

@ApiModel("统一的返回值格式")
public class DataGridView<T>{

    @ApiModelProperty("是否请求合法")
    private boolean code = true;
    @ApiModelProperty("返回的说明信息")
    private String msg = "";
    @ApiModelProperty("返回的数据")
    private T data = null;

    public DataGridView(boolean code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public DataGridView(boolean code, String msg, T data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

    public boolean getCode() {
        return code;
    }

    public void setCode(boolean code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Object getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    @Override
    public String toString() {
        return "DataGridView{" +
                "code=" + code +
                ", msg='" + msg + '\'' +
                ", data=" + data +
                '}';
    }
}
